﻿using DatabaseBenchmark;
using System;
using System.Diagnostics;
using System.IO;
using HaoCoding.DCdb.General.Extensions;
using HaoCoding.DCdb.Database;

namespace HaoCoding.DCdb.GettingStarted
{
    class Program
    {
        static void Main(string[] args)
        {
            Example(10000000, KeysType.Random);

            Console.ReadKey();
        }

        private static void Example(int tickCount, KeysType keysType)
        {
            Stopwatch sw = new Stopwatch();
            const string FILE_NAME = "test.stsdb4";
            File.Delete(FILE_NAME);

            //insert
            Console.WriteLine("Inserting...");
            sw.Reset();
            sw.Start();
            int c = 0;
            using (IStorageEngine engine = STSdb.FromFile(FILE_NAME))
            {

            }
            sw.Stop();
            Console.WriteLine("Insert speed:{0} rec/sec", sw.GetSpeed(tickCount));
        }
    }
}
